package com.example.demo.mapper;

import com.example.demo.entity.Classes;
import com.example.demo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author:wjup
 * @Date: 2018/9/26 0026
 * @Time: 15:20
 */
@Repository
public interface UserMapper {

    User getUser(int id);

    void addUser(User user);

    void delUser(int id);

    void updateUser(User user);

    List<User> getAllUser();

    List<User> getAllUserLike(@Param("name") String name);

    //使用注解 不跟mapping产生关系
    @Insert("insert into t_user (passWord,realName) values(#{passWord},#{realName})")
    public int addUserByAn(User user);

//测试一对多
    Classes getClass(int id);

//多对多
    Classes getClass3(int id);


//    调用存储过程
    Integer getUserCount(Map<String, Integer> map);

    List<User> findUser(User user);
}
